home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR10 / TGE129C.ZIP / TGE.DOC < prev    next >
Text File  |  1993-08-20  |  102KB  |  2,140 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.               The Graphics Engine version 1.29ßC Documentation
  7.                         *** PUBLIC BETA VERSION ***
  8.                               August 20, 1993
  9.  
  10.        The Graphics Engine software and manual are copyright (c) 1993
  11.                 by Matthew Hildebrand.  All rights reserved.
  12.  
  13.  
  14.  
  15.  
  16. Topics covered in this document:
  17. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  18.  
  19.      INTRODUCTION
  20.      WHY USE TGE?
  21.      SYSTEM REQUIREMENTS
  22.      PACKING LIST
  23.      RELEASE NOTES FOR VERSION 1.29ßC
  24.      FUNDAMENTALS OF GRAPHICS PROGRAMMING
  25.      INCORPORATING TGE
  26.      TGE'S GRAPHICAL FUNCTION SET
  27.      VIEWPORTS AND CLIPPING
  28.      VIRTUAL COORDINATES
  29.      VIRTUAL SCREENS
  30.      GRAPHICAL OUTPUT MODES
  31.      FONTS
  32.      BITMAP MANIPULATION
  33.      USING THE MOUSE
  34.      TGE'S MOUSE FUNCTION SET
  35.      CREATING FONTS
  36.      USING THE PCX2RAW UTILITY
  37.      TERMS OF USAGE AND DISTRIBUTION
  38.      CONTACTING THE AUTHOR
  39.      OBTAINING THE NEWEST VERSION OF TGE
  40.      REVISION HISTORY
  41.      KNOWN PROBLEMS USING TGE
  42.      ACKNOWLEDGEMENT
  43.      LEGAL MUMBO JUMBO
  44.  
  45.  
  46.  
  47.  
  48. INTRODUCTION
  49. ▀▀▀▀▀▀▀▀▀▀▀▀
  50.  
  51.      The Graphics Engine is the result of my efforts to construct a library
  52.      of routines designed to make writing C/C++ graphics applications
  53.      easier.  I have used it in my own programs with excellent results.
  54.  
  55.      TGE allows the DOS programmer to easily access many graphics modes,
  56.      without having to do special coding for each; the complications
  57.      involved with supporting more than one graphics mode are removed.  TGE
  58.      also provides remarkable flexibility and expandability through its
  59.      modular design.
  60.  
  61.  
  62.  
  63. WHY USE TGE?
  64. ▀▀▀▀▀▀▀▀▀▀▀▀
  65.  
  66.      TGE provides a simple, standard interface with which programs may
  67.      access a powerful library of graphical functions.
  68.  
  69.      TGE supports device-independence using loadable drivers, loadable
  70.      fonts, viewports, virtual screens, graphics output using COPY, AND,
  71.      NOT, OR, and XOR, bitmap scaling, and interrupt-driven definable mouse
  72.      pointer services.  It has a large number of mouse routines, an
  73.      extensive graphical function set, and a virtual coordinate system to
  74.      make device-independence easier.
  75.  
  76.      TGE's use of loadable graphics drivers means that all code and data
  77.      necessary to handle a certain graphics mode is stored in a disk file.
  78.      When a program runs, this file will be loaded into memory and the code
  79.      it contains will be made available.  Consequently:
  80.           - Support for more graphics modes may be added simply by creating
  81.      more drivers; programs need not be recompiled.
  82.           - Since the code to manage the specifics of each mode is
  83.      contained in the drivers, the main program needs not concern itself
  84.      with what mode it is operating in.  The same code can work in any
  85.      graphics mode.
  86.           - Memory is saved for programs which support many graphics modes.
  87.      Instead of keeping the code and data necessary for each in memory at
  88.      all times, only the memory required for one driver is used.
  89.  
  90.      When writing drivers, it is not necessary to write assembly code for
  91.      every graphical function that TGE supports.  For instance, if a
  92.      certain driver does not contain a line-drawing routine, TGE will
  93.      substitute a default routine.  Therefore, the programmer needs not
  94.      waste time writing assembly code which will seldom or never be used,
  95.      thus slashing development time.  Essentially, no matter what a
  96.      particular driver contains, the entire set of TGE's graphical
  97.      functions will be available.
  98.  
  99.      In addition to essential graphical functions, TGE also includes
  100.      interrupt-driven definable mouse pointer services, as well as a large
  101.      number of functions to interface with the mouse driver.
  102.  
  103.      The names of the graphical functions, such as "putImage" and
  104.      "filledRect" may easily be changed to suit individual preferences.
  105.  
  106.      TGE is powerful, fast, and cheap.  Upgrades are free.
  107.  
  108.  
  109.  
  110. SYSTEM REQUIREMENTS
  111. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  112.  
  113.      TGE is a C/C++ programmer's library.  As such, it requires a C or C++
  114.      compiler of some sort to work with it.  TGE was written and tested
  115.      with Borland C++ 2.0 and Turbo C 2.0; it should work with other C/C++
  116.      compilers as well.
  117.  
  118.      The drivers that come with TGE are written using 80386 instructions.
  119.      They therefore cannot be used on a processor older than the 386 unless
  120.      they are modified first.
  121.  
  122.      Loadable drivers must be written in assembly language.  In order to
  123.      write drivers, an assembler will be required.
  124.  
  125.      The font and virtual coordinate systems are written in C++, not C. In
  126.      order to use loadable fonts or VCOORD.H, a C++ compiler will be
  127.      required.
  128.  
  129.  
  130.  
  131. PACKING LIST
  132. ▀▀▀▀▀▀▀▀▀▀▀▀
  133.  
  134.      The current version of TGE consists of the following files:
  135.  
  136.      TGE.DOC             TGE documentation
  137.      TGEDEMO.EXE         TGE demo program
  138.      320X200.DRV         Driver for VGA 320x200x256
  139.      320X240.DRV         Driver for VGA 320x240x256
  140.      320X400.DRV         Driver for VGA 320x400x256
  141.      360X480.DRV         Driver for VGA 360x480x256
  142.      640X480.DRV         Driver for SuperVGA/VESA 640x480x256 
  143.      800X600.DRV         Driver for SuperVGA/VESA 800x600x256 
  144.      1024X768.DRV        Driver for SuperVGA/VESA 1024x768x256 
  145.      8X8.FNT             8x8 font definition file
  146.      8X14.FNT            8x14 font definition file
  147.      8X16.FNT            8x16 font definition file
  148.      SIMPLE.CPP          A skeleton TGE program showing interface basics
  149.      PCX2RAW.ARJ         Image format translation utility and its source
  150.                          code
  151.           PCX2RAW.EXE    Executable version
  152.           PCX2RAW.CPP    Source for above
  153.           PCX.CPP        PCX routines
  154.           TYPES.H        Some handy typedefs
  155.      SOURCE.ARJ          Full source code
  156.           TGE.H          TGE header file
  157.           TGE.C          Main C file
  158.           TGEDEMO.CPP    Source for TGEDEMO.EXE
  159.           CLIP.C         Supplementary clipping routines
  160.           TGEFONT.H      Header file for TGE fonts
  161.           TGEFONT.CPP    TGE font support (C++ only)
  162.           TGEMOUSE.H     Mouse header file
  163.           TGEMOUSE.ASM   Various mouse routines
  164.           MOUSEPTR.C     Definable mouse pointer support
  165.           NEWMOUSE.ASM   More definable pointer support
  166.           VCOORD.H       Virtual coordinate system header file (C++ only)
  167.           SCALE.C        Bitmap scaling routine
  168.           320X200.ASM    320x200x256 source
  169.           320X240.ASM    320x240x256 source
  170.           320X400.ASM    320x400x256 source
  171.           360X480.ASM    360x480x256 source
  172.           640X480.ASM    640x480x256 source
  173.           800X600.ASM    800x600x256 source
  174.           1024X768.ASM   1024x768x256 source
  175.           SHELL.ASM      Skeleton driver source; use this file as a basis
  176.                          in making custom drivers
  177.      REGISTER.FRM        Registration form
  178.      BETATEST.DOC        Information regarding 1.29ßC as a public beta
  179.                          release
  180.      FILE_ID.DIZ         Archive description file used by some BBSs
  181.  
  182.  
  183.      If you did not receive all of these files, you have an illegal copy of
  184.      The Graphics Engine.
  185.  
  186.  
  187.  
  188. RELEASE NOTES FOR VERSION 1.29ßC
  189. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  190.  
  191.      THIS VERSION OF TGE IS A PUBLIC BETA VERSION.  It contains a few known
  192.      bugs, and it is not yet entirely completed.  TGE 1.30 will be released
  193.      when 1.29ßC is debugged and completed.  In the interim, 1.29ßC should
  194.      be stable enough for most purposes.
  195.  
  196.      **IMPORTANT**:  TGE will no longer save and restore the palette during
  197.      text/graphics switches.  Also, setBlockPalette() and getBlockPalette()
  198.      now have a slightly different argument list; refer to the
  199.      documentation for these functions for details.
  200.  
  201.      Now for the nifty new stuff:
  202.         - Support for virtual screens of varying sizes.
  203.         - A virtual coordinate system to ease the task of dealing with
  204.           multiple resolutions.
  205.         - Output using COPY, AND, NOT, OR, and XOR (even to virtual
  206.           screens).
  207.         - Input and output need not operate on the same place; ie., it is
  208.           possible to input from a virtual screen and output to the real
  209.           screen, perform both input and output on a virtual screen, etc..
  210.         - There is now an input viewport and an output viewport, which
  211.           operate independently.  (ie. the input viewport is used for input
  212.           operations such as getImage(), while the output viewport is used
  213.           for output operations such as drawRect().)
  214.         - The functions imageSizeDim(), putLineInv(), and vertLine() have
  215.           been added.
  216.         - There is now a bitmap scaling feature, via scaleBitmap().
  217.         - The PCX2RAW utility and the font file structure are now
  218.           documented.  (Oops...)
  219.  
  220.      The drivers used with this release are not compatible with those from
  221.      version 1.20 or older, since many changes have been made to the driver
  222.      structure in order to allow for these new features.
  223.  
  224.  
  225.  
  226. FUNDAMENTALS OF GRAPHICS PROGRAMMING
  227. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  228.  
  229.      A graphics screen is composed of thousands or even hundreds of
  230.      thousands of coloured dots called "pixels".  Each pixel is referenced
  231.      according to its offset, in coordinate form, from the upper-left of
  232.      the screen:  (0,0), or the "origin".  The 'x' of a pixel's (x,y)
  233.      location signifies the column number, and the 'y' signifies the row
  234.      number; for example, a 640x480 screen would have (0,0) in the upper-
  235.      left and (639,479) in the lower-right.
  236.  
  237.      Each of these pixels has a colour which is recorded as a number,
  238.      ranging from 0..255 in 256-colour modes.  Each of these numbers is an
  239.      index into a table of colours which the video card maintains:  the
  240.      "palette".  The palette is what determines which colour is represented
  241.      by certain numbers; for instance, what colour is colour number 196?
  242.      Blue?  Green?  Purple?  It depends on the current setting of the
  243.      palette register for colour number 196.
  244.  
  245.      Each of these palette registers consists of three components:  the
  246.      red, green, and blue values, each of which is in the range 0..255. All
  247.      the displayable colours are composed of these three primary colours in
  248.      some proportion.  For instance, a purple would have lots of red and
  249.      blue, but little or no green.
  250.  
  251.      The palette can be a powerful tool, as changing palette register, say,
  252.      48, causes all pixels on-screen with the value of 48 to instantly
  253.      change to the new colour.  It is important to keep in mind that the
  254.      palette is a global palette; ie. it affects the entire screen.
  255.  
  256.      That's all there is to it!
  257.  
  258.  
  259.  
  260. INCORPORATING TGE
  261. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  262.  
  263.      Incorporating TGE into a program is an easy process involving three
  264.      simple steps.
  265.  
  266.  
  267.      First, the header file TGE.H must be #included into any source file
  268.      which accesses any of TGE's routines.  TGE.C must be compiled, and the
  269.      resulting .OBJ file linked into the .EXE file.
  270.  
  271.      Second, a graphics driver MUST be loaded before any code or data
  272.      contained in the driver is accessed; results are undefined if this
  273.      step is not taken.  Code to load a driver might look like this:
  274.  
  275.           if (loadGraphDriver(drvFileName) != TGE_SUCCESS)
  276.           {
  277.             printf("Error loading %s, aborting.\n\n", drvFileName);
  278.             exit(1);
  279.           }
  280.           else
  281.             atexit(unloadGraphDriver);
  282.  
  283.      The function loadGraphDriver() must be called.  As its only parameter,
  284.      it takes a string consisting of the file name (which may include any
  285.      valid DOS path) of the driver to be loaded.  It returns a success
  286.      code:  TGE_SUCCESS if the loading was successful, or one of
  287.      TGE_OPEN_ERR (file not found), TGE_FORMAT_ERR (file is not a valid TGE
  288.      driver), TGE_ALLOC_ERR (out of memory), and TGE_FILE_ERR (general file
  289.      I/O error) if an error occurred.  These macros are defined in TGE.H.
  290.  
  291.      Third, after TGE's graphical functions are no longer needed (usually
  292.      just before a program exit), the function unloadGraphDriver() should
  293.      be called.  It takes no parameters, and returns nothing.  It simply
  294.      frees the memory taken up by a driver after it has been loaded.  (With
  295.      some compilers it is not necessary to call this function, but it's
  296.      safer to call it just to be sure.)  It is often a good idea to place
  297.      unloadGraphDriver() in the atexit() queue.
  298.  
  299.  
  300.      Note that the initGraphics() function must be called to enter graphics
  301.      mode; for more information, see the next section.  Information on
  302.      incorporating TGE's mouse routines may be found in the section
  303.      entitled USING THE MOUSE.
  304.  
  305.  
  306.  
  307. TGE'S GRAPHICAL FUNCTION SET
  308. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  309.  
  310.      After a driver has been loaded, all of TGE's graphical functions can
  311.      be accessed.  To call a function, simply execute
  312.  
  313.           functionName(parameter list);
  314.  
  315.      where "functionName" is the name of the desired function (eg. "line"
  316.      or "filledRect") and "parameter list" is all parameters to that
  317.      function, if any.
  318.  
  319.      A complete list of TGE's graphical functions follows.
  320.  
  321.  
  322.  *** Function:      initGraphics()
  323.      Syntax:        void huge initGraphics(void);
  324.      Purpose:       Initialize graphics mode.
  325.      Parameters:    None.
  326.      Return value:  1 on success or 0 on error.
  327.      Remarks:       None.
  328.      See also:      deInitGraphics()
  329.  
  330.  *** Function:      deInitGraphics()
  331.      Syntax:        void deInitGraphics(void);
  332.      Purpose:       Revert to 80x25 colour text mode.
  333.      Parameters:    None.
  334.      Return value:  None.
  335.      Remarks:       None.
  336.      See also:      initGraphics()
  337.  
  338.  *** Function:      putImage()
  339.      Syntax:        void huge putImage(int x, int y, void far *image);
  340.      Purpose:       Place a bitmap, or image, onto the screen.
  341.      Parameters:    The bitmap contained in 'image' will be placed onto the
  342.                     screen with its upper-left coordinate at ('x','y').
  343.      Return value:  None.
  344.      Remarks:            Clipping is performed; the image may be placed
  345.                     entirely on-screen, partially on-screen, or entirely
  346.                     off-screen.
  347.                          This function is declared as huge so that it will
  348.                     work properly when called from within an interrupt
  349.                     service routine.
  350.      See also:      putImageInv(), getImage(), imageSize(), putLine(),
  351.                     putLineInv(), getLine()
  352.  
  353.  *** Function:      putImageInv()
  354.      Syntax:        void huge putImageInv(int x, int y, void far *image);
  355.      Purpose:       Place a bitmap, or image, on the screen.
  356.      Parameters:    The bitmap contained in 'image' will be placed onto the
  357.                     screen with its upper-left coordinate at ('x','y').
  358.      Return value:  None.
  359.      Remarks:            Clipping is performed; the image may be placed
  360.                     entirely on-screen, partially on-screen, or entirely
  361.                     off-screen.    putImageInv() differs from putImage()
  362.                     only in that it allows for transparent, or invisible,
  363.                     colours.  If any pixel in the image buffer has a value
  364.                     of zero, the corresponding pixel on-screen will not be
  365.                     modified.  Using putImageInv() can avoid having black
  366.                     borders around non-rectangular shapes.
  367.                          This function is declared as huge so that it will
  368.                     work properly when called from within an interrupt
  369.                     service routine.
  370.      See also:      putImage(), getImage(), imageSize(), putLineInv(),
  371.                     putLine(), getLine()
  372.  
  373.  *** Function:      getImage()
  374.      Syntax:        void huge getImage(int ulx, int uly, int lrx, int lry,
  375.                     void far *image);
  376.      Purpose:       Copy the specified rectangular portion of the screen to
  377.                     memory.
  378.      Parameters:    The portion of the screen with its upper-left
  379.                     coordinate at ('ulx','uly') and its lower-left
  380.                     coordinate at ('lrx','lry') will be copied into the
  381.                     previously allocated memory region at 'image' (see
  382.                     imageSize()).
  383.      Return value:  None.
  384.      Remarks:            Clipping is performed.  Note that only the portion
  385.                     of the specified region which lies within the current
  386.                     viewport will be placed in the image buffer by
  387.                     getImage().  Be careful not to assume that a getImage()
  388.                     image has off-screen data in it.
  389.                          This function is declared as huge so that it will
  390.                     work properly when called from within an interrupt
  391.                     service routine.
  392.      See also:      putImage(), putImageInv(), imageSize(), getLine(),
  393.                     putLine(), putLineInv()
  394.  
  395.  *** Function:      imageSize()
  396.      Syntax:        unsigned long imageSize(int ulx, int uly, int lrx, int
  397.                     lry);
  398.      Purpose:       Determine the amount of memory required to hold a
  399.                     rectangular portion of the screen.
  400.      Parameters:    imageSize() will calculate the amount of memory
  401.                     required to hold the porion of the screen whose upper-
  402.                     left coordinate is ('ulx','uly') and whose lower-left
  403.                     coordinate is ('lrx','lry').
  404.      Return value:  imageSize returns an unsigned long containing the size
  405.                     of the area in bytes.
  406.      Remarks:            Clipping is performed.
  407.                          imageSize() is designed for use with putImage(),
  408.                     putImageInv(), and getImage().  To use it with
  409.                     putLine() and getLine(), subtract 4 from the value it
  410.                     returns.  (Image buffers have four bytes of dimension
  411.                     information in them; line buffers do not.)
  412.      See also:      imageSizeDim(), putImage(), putImageInv(), getImage(),
  413.                     putLine(), getLine()
  414.  
  415.  *** Function:      imageSizeDim()
  416.      Syntax:        unsigned long imageSizeDim(unsigned wide, unsigned
  417.                     deep);
  418.      Purpose:       Determine the amount of memory required to hold a
  419.                     rectangular portion of the screen.
  420.      Parameters:    imageSize() will calculate the amount of memory
  421.                     required to hold the porion of the screen with width
  422.                     'wide' and depth 'deep'.
  423.      Return value:  imageSize returns an unsigned long containing the size
  424.                     of the area in bytes.
  425.      Remarks:            Clipping is not performed.
  426.                          imageSizeDim() is designed for use with
  427.                     putImage(), putImageInv(), and getImage().  To use it
  428.                     with putLine() and getLine(), subtract 4 from the value
  429.                     it returns.  (Image buffers have four bytes of
  430.                     dimension information in them; line buffers do not.)
  431.      See also:      imageSize(), putImage(), putImageInv(), getImage(),
  432.                     putLine(), getLine()
  433.  
  434.  *** Function:      putLine()
  435.      Syntax:        void putLine(int lineNum, int xOff, int lineLen, void
  436.                     far *buf);
  437.      Purpose:       Place one horizontal line of image data on the screen.
  438.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  439.                     pixels, will be placed on-screen starting at
  440.                     ('xOff','lineNum').
  441.      Return value:  None.
  442.      Remarks:       No clipping is performed.  Results are undefined if any
  443.                     coordinate on the line is off-screen.
  444.      See also:      putLineInv(), getLine(), putImage(), putImageInv(),
  445.                     getImage()
  446.  
  447.  *** Function:      putLineInv()
  448.      Syntax:        void putLineInv(int lineNum, int xOff, int lineLen,
  449.                     void far *buf);
  450.      Purpose:       Place one horizontal line of image data on the screen,
  451.                     leaving a pixel unchanged if the corresponding pixel in
  452.                     the source buffer has a value of zero.  This function
  453.                     is the single-line equivalent to putImageInv().
  454.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  455.                     pixels, will be placed on-screen starting at
  456.                     ('xOff','lineNum').
  457.      Return value:  None.
  458.      Remarks:       No clipping is performed.  Results are undefined if any
  459.                     coordinate on the line is off-screen.
  460.      See also:      putLine(), getLine(), putImage(), putImageInv(),
  461.                     getImage()
  462.  
  463.  *** Function:      getLine()
  464.      Syntax:        void getLine(int lineNum, int xOff, int lineLen, void
  465.                     far *buf);
  466.      Purpose:       Copy one horizontal line from the screen to memory.
  467.      Parameters:    The horizontal line whose left coordinate is
  468.                     ('xOff','lineNum') and whose length is 'lineLen' pixels
  469.                     will be copied into the previously allocated memory
  470.                     region at 'buf'.
  471.      Return value:  None.
  472.      Remarks:       No clipping is performed.  Results are undefined if any
  473.                     coordinate on the line is off-screen.
  474.      See also:      putLine(), putLineInv(), putImage(), putImageInv(),
  475.                     getImage()
  476.  
  477.  *** Function:      putPixel()
  478.      Syntax:        void putPixel(int x, int y, unsigned colour);
  479.      Purpose:       Place a single pixel on-screen.
  480.      Parameters:    The pixel located at ('x','y') will be set to the
  481.                     colour 'colour'.
  482.      Return value:  None.
  483.      Remarks:       Clipping is not performed; see clipPoint() and
  484.                     pointOnScreen() for details on clipping pixels.
  485.      See also:      getPixel()
  486.  
  487.  *** Function:      getPixel()
  488.      Syntax:        unsigned getPixel(int x, int y);
  489.      Purpose:       Return the value of a pixel.
  490.      Parameters:    The value of the pixel at ('x','y') is returned.
  491.      Return value:  The value of the pixel at (x,y) is returned.
  492.      Remarks:       Clipping is not performed; see clipPoint() and
  493.                     pointOnScreen() for details on clipping pixels.
  494.      See also:      putPixel()
  495.  
  496.  *** Function:      line()
  497.      Syntax:        void line(int x1, int y1, int x2, int y2, unsigned
  498.                     colour);
  499.      Purpose:       Draw a line between two points.
  500.      Parameters:    The line will be drawn joining ('x1','y1') and
  501.                     ('x2','y2') in the colour 'colour'.
  502.      Return value:  None.
  503.      Remarks:       Clipping is not performed; see clipLine() for details
  504.                     on clipping lines.
  505.      See also:      horizLine(), vertLine()
  506.  
  507.  *** Function:      horizLine()
  508.      Syntax:        void horizLine(int y, int x1, int x2, unsigned colour);
  509.      Purpose:       Draw a horizontal line between two points.
  510.      Parameters:    The line will be drawn between ('x1','y') and
  511.                     ('x2','y') in the colour contained in colour.
  512.      Return value:  None.
  513.      Remarks:            Clipping is not performed.
  514.                          'x1' must be less than or equal to 'x2'.
  515.      See also:      vertLine(), line()
  516.  
  517.  *** Function:      vertLine()
  518.      Syntax:        void vertLine(int x, int y1, int y2, unsigned colour);
  519.      Purpose:       Draw a vertical line between two points.
  520.      Parameters:    The line will be drawn between ('x','y1') and
  521.                     ('x','y2') in the colour contained in colour.
  522.      Return value:  None.
  523.      Remarks:            Clipping is not performed.
  524.                          'y1' must be less than or equal to 'y2'.
  525.      See also:      horizLine(), line()
  526.  
  527.  *** Function:      drawRect()
  528.      Syntax:        void drawRect(int ulx, int uly, int lrx, int lry,
  529.                     unsigned colour);
  530.      Purpose:       Draw a rectangle.
  531.      Parameters:    The rectangle will be drawn with its upper-left
  532.                     coordinates at ('ulx','uly') and its lower-left
  533.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  534.      Return value:  None.
  535.      Remarks:       Clipping is performed.
  536.      See also:      filledRect()
  537.  
  538.  *** Function:      filledRect()
  539.      Syntax:        void filledRect(int ulx, int uly, int lrx, int lry,
  540.                     unsigned colour);
  541.      Purpose:       Draw a filled rectangle.
  542.      Parameters:    The rectangle will be drawn with its upper-left
  543.                     coordinates at ('ulx','uly') and its lower-left
  544.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  545.      Return value:  None.
  546.      Remarks:       Clipping is not performed; see clipFilledRect() for
  547.                     details on clipping filledRects.
  548.      See also:      drawRect()
  549.  
  550.  *** Function:      setPaletteReg()
  551.      Syntax:        void setPaletteReg(unsigned palReg, unsigned char red,
  552.                     unsigned char green, unsigned char blue);
  553.      Purpose:       Set a palette register.
  554.      Parameters:    The red, green, and blue components of the palette
  555.                     register palReg will be set to 'red', 'green', and
  556.                     'blue' respectively.
  557.      Return value:  None.
  558.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  559.                     should be in the range 0..255, not 0..63 as would be
  560.                     the case using a stock VGA.  The drivers will take care
  561.                     of converting 8-bit to 6-bit palette resolution if
  562.                     necessary.
  563.      See also:      getPaletteReg(), setBlockPalette(), getBlockPalette()
  564.  
  565.  *** Function:      getPaletteReg()
  566.      Syntax:        void getPaletteReg(unsigned palReg, unsigned char far
  567.                     *red, unsigned char far *green, unsigned char far
  568.                     *blue);
  569.      Purpose:       Return the current settings of a palette register.
  570.      Parameters:    The red, green, and blue contents of the palette
  571.                     register palReg will be stored in 'red', 'green', and
  572.                     'blue' respectively.
  573.      Return value:  The red, green, and blue components of the palette
  574.                     register are returned in 'red', 'green', and 'blue'.
  575.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  576.                     are in the range 0..255, not 0..63 as would be the case
  577.                     using a stock VGA card.  The drivers will take care of
  578.                     converting 8-bit to 6-bit palette resolution if
  579.                     necessary.
  580.      See also:      setPaletteReg(), setBlockPalette(), getBlockPalette()
  581.  
  582.  *** Function:      setBlockPalette()
  583.      Syntax:        void setBlockPalette(unsigned firstReg, unsigned
  584.                     lastReg, void far *data);
  585.      Purpose:       Set a block of palette registers.
  586.      Parameters:    The palette registers starting at 'firstReg' and ending
  587.                     at 'lastReg' will be set to the values contained in
  588.                     'data'.
  589.      Return value:  None.
  590.      Remarks:            The memory region at 'data' is organised in groups
  591.                     of three bytes; each group corresponds to one palette
  592.                     register, and each group is made up of, in order, the
  593.                     red, green, and blue components.  The first group is
  594.                     for the first register, the second for the second, and
  595.                     so on.
  596.                          Each of the colour components (red, green, blue)
  597.                     should be in the range 0..255, not 0..63 as would be
  598.                     the case using a stock VGA.  The drivers will take care
  599.                     of converting 8-bit to 6-bit palette resolution if
  600.                     necessary.
  601.                          Results are undefined if 'lastReg' is less than
  602.                     'firstReg'.
  603.      See also:      getBlockPalette(), setPaletteReg(), getPaletteReg()
  604.  
  605.  *** Function:      getBlockPalette()
  606.      Syntax:        void getBlockPalette(unsigned firstReg, unsigned
  607.                     lastReg, void far *data);
  608.      Purpose:       Get the values of a block of palette registers.
  609.      Parameters:    The values of the palette registers starting at
  610.                     'firstReg' and ending at 'lastReg' will be stored in
  611.                     the previously allocated 'data'.
  612.      Return value:  The values are returned in 'data'.
  613.      Remarks:            The memory region at 'data' is organised in groups
  614.                     of three bytes; each group corresponds to one palette
  615.                     register, and each group is made up of, in order, the
  616.                     red, green, and blue components.  The first group is
  617.                     for the first register, the second for the second, and
  618.                     so on.
  619.                          Each of the colour components (red, green, blue)
  620.                     is in the range 0..255, not 0..63 as would be the case
  621.                     using a stock VGA.  The drivers will take care of
  622.                     converting 8-bit to 6-bit palette resolution if
  623.                     necessary.
  624.                          Results are undefined if 'lastReg' is less than
  625.                     'firstReg'.
  626.      See also:      setBlockPalette(), setPaletteReg(), getPaletteReg()
  627.  
  628.  *** Function:      clearGraphics()
  629.      Syntax:        void clearGraphics(unsigned colour);
  630.      Purpose:       Clear the screen.
  631.      Parameters:    The screen will be cleared to the colour 'colour'.
  632.      Return value:  None.
  633.      Remarks:       This function clears the entire screen, not just the
  634.                     current viewport.
  635.      See also:      filledRect()
  636.  
  637.  *** Function:      ellipse()
  638.      Syntax:        void ellipse(int x, int y, int wide, int deep, unsigned
  639.                     colour);
  640.      Purpose:       Draw the outline of an ellipse.
  641.      Parameters:    An ellipse centered at ('x','y') and having width
  642.                     'wide' and depth 'deep' will be drawn in the colour
  643.                     'colour'.
  644.      Return value:  None.
  645.      Remarks:       Clipping is performed.
  646.      See also:      filledEllipse(), circle(), filledCircle()
  647.  
  648.  *** Function:      filledEllipse()
  649.      Syntax:        void filledEllipse(x, int y, int wide, int deep,
  650.                     unsigned colour);
  651.      Purpose:       Draw a filled ellipse.
  652.      Parameters:    An ellipse centered at ('x','y') and having width
  653.                     'wide' and depth 'deep' will be drawn in the colour
  654.                     'colour'.
  655.      Return value:  None.
  656.      Remarks:       Clipping is performed.
  657.      See also:      ellipse(), filledCircle(), circle()
  658.  
  659.  *** Function:      circle()
  660.      Syntax:        void circle(int x, int y, int radius, unsigned colour);
  661.      Purpose:       Draw the outline of a circle.
  662.      Parameters:    A circle centered at ('x','y') and having radius
  663.                     'radius' will be drawn in the colour 'colour'.
  664.      Return value:  None.
  665.      Remarks:            Clipping is performed.
  666.                          The 'radius' parameter is the radius in pixels
  667.                     measured horizontally.  Although there will be no
  668.                     difference in modes with square pixels, it will make a
  669.                     difference in other modes; to ensure accurate drawing
  670.                     of the circle with the given radius, make certain that
  671.                     the radius is measured horizontally.
  672.                          TGE uses an all-integer approach to coordinate
  673.                     scaling to ensure that the drawn shape will be circular
  674.                     in modes without square pixels.
  675.      See also:      filledCircle(), filledEllipse(), ellipse()
  676.  
  677.  *** Function:      filledCircle()
  678.      Syntax:        void filledCircle(int x, int y, int radius, unsigned
  679.                     colour);
  680.      Purpose:       Draw a filled circle.
  681.      Parameters:    A circle centered at ('x','y') and having radius
  682.                     'radius' will be drawn in the colour 'colour'.
  683.      Return value:  None.
  684.      Remarks:            Clipping is performed.
  685.                          The 'radius' parameter is the radius in pixels
  686.                     measured horizontally.  Although there will be no
  687.                     difference in modes with square pixels, it will make a
  688.                     difference in other modes; to ensure accurate drawing
  689.                     of the circle with the given radius, make certain that
  690.                     the radius is measured horizontally.
  691.                          TGE uses an all-integer approach to coordinate
  692.                     scaling to ensure that the drawn shape will be circular
  693.                     in modes without square pixels.
  694.      See also:      circle(), ellipse(), filledEllipse()
  695.  
  696.  *** Function:      fillRegion()
  697.      Syntax:        void fillRegion(int x, int y, unsigned colour);
  698.      Purpose:       Floods a region of the screen with the specified
  699.                     colour.
  700.      Parameters:    The fill will begin at the seed point ('x','y'), and
  701.                     will fill with the colour 'colour'.
  702.      Return value:  None.
  703.      Remarks:            The region to be filled is bounded by any colour
  704.                     not equal to the colour at ('x','y'); ie., the region
  705.                     to be filled consists of one colour only.
  706.                          Clipping is performed.
  707.      See also:      None.
  708.  
  709.  *** Function:      colourCloseTo()
  710.      Syntax:        unsigned colourCloseTo(unsigned char red, unsigned char
  711.                     green, unsigned char blue);
  712.      Purpose:       Given a 24-bit colour, find the colour from the current
  713.                     palette which most closely matches it.
  714.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  715.                     'blue' parameters.
  716.      Return value:  Returns the colour which most closely matches the
  717.                     specified 24-bit colour.
  718.      Remarks:       None.
  719.      See also:      colourCloseToX()
  720.  
  721.  *** Function:      colourCloseToX()
  722.      Syntax:        unsigned colourCloseToX(unsigned char red, unsigned
  723.                     char green, unsigned char blue, unsigned
  724.                     colourExclude);
  725.      Purpose:       Given a 24-bit colour, find the colour from the current
  726.                     palette which most closely matches it, with the
  727.                     specified colour disallowed from the search.
  728.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  729.                     'blue' parameters.  The colour 'colourExclude' is
  730.                     excluded from the search, and so will never be
  731.                     returned.
  732.      Return value:  Returns the colour which most closely matches the
  733.                     specified 24-bit colour.
  734.      Remarks:       Excluding zero from a search will ensure that the
  735.                     returned colour will be visible when it is used as part
  736.                     of a bitmap displayed using putImageInv().
  737.      See also:      colourCloseTo()
  738.  
  739.  
  740.      Note that since these function names are actually macros, they may
  741.      easily be changed to suit individual preferences by editing TGE.H.
  742.  
  743.  
  744.  
  745. VIEWPORTS AND CLIPPING
  746. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  747.  
  748.      A viewport is a rectangular region on the screen to which output is
  749.      clipped, so that graphics output will appear only within that region.
  750.      By default, this region is the entire screen; however, it can be set
  751.      to any portion of the screen.  (Note that when a viewport is in use,
  752.      coordinates are absolute, not relative to the viewport.)
  753.  
  754.      TGE now supports two viewports simultaneously:  an input viewport and
  755.      an output viewport.  This feature was added primarily so that virtual
  756.      screens (see the VIRTUAL SCREENS section) and the real screen could be
  757.      used simultaneously, though it may have other uses as well.  The
  758.      following functions are used to get and set the current input and
  759.      output viewports:
  760.  
  761.  *** Function:      setInputViewport()
  762.      Syntax:        void setInputViewport(int ulx, int uly, int lrx, int lry);
  763.      Purpose:       Set the defining coordinates of the current input
  764.                     viewport.
  765.      Parameters:    The upper-left corner of the input viewport will be set to
  766.                     ('ulx','uly'), and the lower-right corner to
  767.                     ('lrx','lry').
  768.      Return value:  None.
  769.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  770.      See also:      setOutputViewport(), setViewport(), getInputViewport(),
  771.                     getOutputViewport()
  772.  
  773.  *** Function:      setOutputViewport()
  774.      Syntax:        void setOutputViewport(int ulx, int uly, int lrx, int lry);
  775.      Purpose:       Set the defining coordinates of the current output
  776.                     viewport.
  777.      Parameters:    The upper-left corner of the output viewport will be set
  778.                     to ('ulx','uly'), and the lower-right corner to
  779.                     ('lrx','lry').
  780.      Return value:  None.
  781.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  782.      See also:      setInputViewport(), setViewport(), getOutputViewport(),
  783.                     getInputViewport()
  784.  
  785.  *** Function:      setViewport()
  786.      Syntax:        void setViewport(int ulx, int uly, int lrx, int lry);
  787.      Purpose:       Set the defining coordinates of the current input and
  788.                     output viewports.
  789.      Parameters:    The upper-left corner of the viewports will be set to
  790.                     ('ulx','uly'), and the lower-right corner to
  791.                     ('lrx','lry').
  792.      Return value:  None.
  793.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  794.      See also:      setInputViewport(), setOutputViewport(),
  795.                     getInputViewport(), getOutputViewport()
  796.  
  797.  *** Function:      getInputViewport()
  798.      Syntax:        void getInputViewport(int *ulx, int *uly, int *lrx, int
  799.                     *lry);
  800.      Purpose:       Get the defining coordinates of the current input
  801.                     viewport.
  802.      Parameters:    The upper-left corner of the input viewport will be stored
  803.                     in ('ulx','uly'), and the lower-right corner in
  804.                     ('lrx','lry').
  805.      Return value:  None.
  806.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  807.      See also:      getOutputViewport(), getViewport(), setInputViewport(),
  808.                     setOutputViewport()
  809.  
  810.  *** Function:      getOutputViewport()
  811.      Syntax:        void getOutputViewport(int *ulx, int *uly, int *lrx, int
  812.                     *lry);
  813.      Purpose:       Get the defining coordinates of the current output
  814.                     viewport.
  815.      Parameters:    The upper-left corner of the output viewport will be
  816.                     stored in ('ulx','uly'), and the lower-right corner in
  817.                     ('lrx','lry').
  818.      Return value:  None.
  819.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  820.      See also:      setOutputViewport(), getViewport(), getInputViewport(),
  821.                     getOutputViewport()
  822.  
  823.  
  824.      Note that not all of TGE's functions will clip to within the current
  825.      output viewport.  Some of the time-critical graphics primitives, such
  826.      as putPixel() and line(), do not clip in order to improve execution
  827.      time.  If it is necessary for such functions to have their output
  828.      clipped, the following routines may be used:
  829.  
  830.  *** Function:      clipFilledRect()
  831.      Syntax:        int clipFilledRect(int *x1, int *y1, int *x2, int *y2);
  832.      Purpose:       Clip the given filled rectangle to within the current
  833.                     viewport.
  834.      Parameters:    The upper-left and lower-right corners of the rectangle
  835.                     are passed in ('x1','y1') and ('x2','y2').  If clipping
  836.                     is done, these points will be modified.
  837.      Return value:  Returns true if the rectangle lies entirely or
  838.                     partially within the current viewport, or false if it
  839.                     is entirely outside the current viewport.
  840.      Remarks:            It does not matter which of the corner coordinates
  841.                     is passed first; they will be swapped if necessary.
  842.                          This function is contained in CLIP.C.
  843.  
  844.  *** Function:      clipLine()
  845.      Syntax:        int clipLine(int *x1, int *y1, int *x2, int *y2);
  846.      Purpose:       Clip the given line to within the current viewport.
  847.      Parameters:    The endpoints of the line are passed in ('x1','y1') and
  848.                     ('x2','y2').  If clipping is done, these endpoints will
  849.                     be modified.
  850.      Return value:  Returns true if the line lies entirely or partially
  851.                     within the current viewport, or false if it is entirely
  852.                     outside the current viewport.
  853.      Remarks:       This function is contained in CLIP.C.
  854.      See also:      None.
  855.  
  856.  *** Function:      clipPoint()
  857.      Syntax:        int clipPoint(int x, int y);
  858.      Purpose:       Return a flag indicating whether or not the specified
  859.                     coordinates lie within the current viewport.
  860.      Parameters:    The point ('x','y') is tested.
  861.      Return value:  Returns true if ('x','y') is within the current
  862.                     viewport, or 0 if it isn't.
  863.      Remarks:       This function is really a macro defined in TGE.H.
  864.      See also:      None.
  865.  
  866.  *** Function:      pointOnScreen()
  867.      Syntax:        int pointOnScreen(int x, int y);
  868.      Purpose:       Return a flag indicating whether or not the specified
  869.                     coordinates lie on-screen.
  870.      Parameters:    The point ('x','y') is tested.
  871.      Return value:  Returns true if ('x','y') is on-screen, or 0 if it is
  872.                     off-screen.
  873.      Remarks:       This function is really a macro defined in TGE.H.
  874.      See also:      None.
  875.  
  876.  
  877.      Note that since these function names are actually macros, they may
  878.      easily be changed to suit individual preferences by editing TGE.H.
  879.  
  880.  
  881.  
  882. VIRTUAL COORDINATES
  883. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  884.  
  885.      One of the problems associated with device-independence is that
  886.      different display modes have different resolutions.  TGE provides a
  887.      simple way to ease this problem, simply by #including VCOORD.H.  Doing
  888.      so provides access to a simple yet powerful object-oriented virtual
  889.      coordinate system.
  890.  
  891.      For the sake of illustration, assume that you are writing an
  892.      application which ideally will be run in resolutions as high as
  893.      1024x768, but can also be run in 320x200.  You want a way to have
  894.      objects (eg., windows) retain the same sizes and positions on-screen
  895.      in any graphics mode.  TGE's virtual coordinate system makes it easy.
  896.      First, create an instance of the virtual coordinate object (I'll call
  897.      the object virtScreen):
  898.  
  899.           VirtualCoord virtScreen;
  900.  
  901.      Then, virtScreen must be configured; I'll assume that the virtual
  902.      screen is to be 1024x768, and that OUTMAXX and OUTMAXY have been
  903.      initialized by loading a driver.  (Note that these parameters may be
  904.      set during the class instantiation by using a different constructor.)
  905.  
  906.           virtScreen.virtParams(1023, 767);
  907.           virtScreen.realParams(OUTMAXX, OUTMAXY);
  908.  
  909.      As an example, assume that you want to draw a light gray rectangle
  910.      with upper-left coordinate (50,50) and lower-right coordinate
  911.      (600,600) on the virtual screen.  On, say, a 360x480 screen these
  912.      values will be quite different; to keep the proportion the same,
  913.      execute a line like the following:
  914.  
  915.           drawRect(virtScreen.realX(50), virtScreen.realY(50),
  916.                    virtScreen.realX(600), virtScreen.realY(600),
  917.                    colourCloseTo(200,200,200));
  918.  
  919.      That's all there is to it!  Keep in mind that there are other
  920.      applications of the VirtualCoord class, aside from a virtual screen;
  921.      it can also be useful when dealing with portions of the screen, scaled
  922.      bitmaps, etc..
  923.  
  924.      A complete list of the VirtualCoord member functions follows.
  925.  
  926.  
  927.  *** Function:      VirtualCoord::VirtualCoord()
  928.      Syntax:        VirtualCoord::VirtualCoord(void);
  929.      Purpose:       Create an instance of the VirtualCoord class.
  930.      Parameters:    None.
  931.      Return value:  None.
  932.      Remarks:       After an instantiation of a VirtualCoord using this
  933.                     constructor, ensure that the screen dimensions, both
  934.                     virtual and real, are initialized using the method
  935.                     illustrated above.
  936.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  937.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  938.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  939.  
  940.  *** Function:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  941.                     unsigned, unsigned)
  942.      Syntax:        VirtualCoord::VirtualCoord(unsigned virtMaxX, unsigned
  943.                     virtMaxY, unsigned realMaxX, unsigned realMaxY);
  944.      Purpose:       Create an instance of the VirtualCoord class, and
  945.                     initialize it.
  946.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  947.                     and the y-coordinate to 'virtMaxY'.  The maximum real
  948.                     x-coordinate is set to 'realMaxX', and the y-coordinate
  949.                     to 'realMaxY'.
  950.      Return value:  None.
  951.      Remarks:       Be sure that a driver has been loaded before passing
  952.                     OUTMAXX and OUTMAXY to this constructor.
  953.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  954.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  955.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  956.  
  957.  *** Function:      VirtualCoord::virtParams(unsigned, unsigned)
  958.      Syntax:        void VirtualCoord::virtParams(unsigned virtMaxX,
  959.                     unsigned virtMaxY);
  960.      Purpose:       Set the maximum virtual x- and y-coordinates.
  961.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  962.                     and the maximum y-coordinate to 'virtMaxY'.
  963.      Return value:  None.
  964.      Remarks:       None.
  965.      See also:      VirtualCoord::realParams(unsigned, unsigned),
  966.                     VirtualCoord::virtParams(unsigned*, unsigned*),
  967.                     VirtualCoord::realParams(unsigned*, unsigned*)
  968.  
  969.  *** Function:      VirtualCoord::realParams(unsigned, unsigned)
  970.      Syntax:        void VirtualCoord::realParams(unsigned virtMaxX,
  971.                     unsigned virtMaxY);
  972.      Purpose:       Set the maximum real x- and y-coordinates.
  973.      Parameters:    The maximum real x-coordinate is set to 'realMaxX', and
  974.                     the maximum y-coordinate to 'realMaxY'.
  975.      Return value:  None.
  976.      Remarks:       None.
  977.      See also:      VirtualCoord::virtParams(unsigned, unsigned),
  978.                     VirtualCoord::realParams(unsigned*, unsigned*),
  979.                     VirtualCoord::virtParams(unsigned*, unsigned*)
  980.  
  981.  *** Function:      VirtualCoord::virtParams(unsigned*, unsigned*)
  982.      Syntax:        void VirtualCoord::virtParams(unsigned *virtMaxX,
  983.                     unsigned *virtMaxY);
  984.      Purpose:       Get the maximum virtual x- and y-coordinates.
  985.      Parameters:    The maximum virtual x-coordinate is stored in
  986.                     'virtMaxX', and the maximum y-coordinate in 'virtMaxY'.
  987.      Return value:  None.
  988.      Remarks:       None.
  989.      See also:      VirtualCoord::realParams(unsigned*, unsigned*),
  990.                     VirtualCoord::virtParams(unsigned, unsigned),
  991.                     VirtualCoord::realParams(unsigned, unsigned)
  992.  
  993.  *** Function:      VirtualCoord::realParams(unsigned*, unsigned*)
  994.      Syntax:        void VirtualCoord::realParams(unsigned *virtMaxX,
  995.                     unsigned *virtMaxY);
  996.      Purpose:       Get the maximum real x- and y-coordinates.
  997.      Parameters:    The maximum real x-coordinate is stored in 'realMaxX',
  998.                     and the maximum y-coordinate in 'realMaxY'.
  999.      Return value:  None.
  1000.      Remarks:       None.
  1001.      See also:      VirtualCoord::virtParams(unsigned*, unsigned*),
  1002.                     VirtualCoord::realParams(unsigned, unsigned),
  1003.                     VirtualCoord::virtParams(unsigned, unsigned)
  1004.  
  1005.  *** Function:      VirtualCoord::realCoords()
  1006.      Syntax:        void VirtualCoord::realCoords(unsigned virtX, unsigned
  1007.                     virtY, unsigned *realX, unsigned *realY);
  1008.      Purpose:       Calculate the real (x,y) coordinates given the virtual
  1009.                     coordinates.
  1010.      Parameters:    The real (x,y) coordinates are returned in
  1011.                     ('realX','realY'), and are calculated based on the
  1012.                     virtual (x,y) coordinates ('virtX','virtY').
  1013.      Return value:  None.
  1014.      Remarks:       None.
  1015.      See also:      VirtualCoord::realX(), VirtualCoord::realY(),
  1016.                     VirtualCoord::virtCoords(), VirtualCoord::virtX(),
  1017.                     VirtualCoord::virtY()
  1018.  
  1019.  *** Function:      VirtualCoord::realX()
  1020.      Syntax:        unsigned VirtualCoord::realX(unsigned virtX);
  1021.      Purpose:       Calculate the real x-coordinate given the virtual x-
  1022.                     coordinate.
  1023.      Parameters:    The real x-coordinate is returned, calculated based on
  1024.                     the virtual x-coordinate 'virtX'.
  1025.      Return value:  Returns the real x-coordinate.
  1026.      Remarks:       None.
  1027.      See also:      VirtualCoord::realY(), VirtualCoord::realCoords(),
  1028.                     VirtualCoord::virtX(), VirtualCoord::virtY(),
  1029.                     VirtualCoord::virtCoords()
  1030.  
  1031.  *** Function:      VirtualCoord::realY()
  1032.      Syntax:        unsigned VirtualCoord::realY(unsigned virtY);
  1033.      Purpose:       Calculate the real y-coordinate given the virtual y-
  1034.                     coordinate.
  1035.      Parameters:    The real y-coordinate is returned, calculated based on
  1036.                     the virtual y-coordinate 'virtY'.
  1037.      Return value:  Returns the real y-coordinate.
  1038.      Remarks:       None.
  1039.      See also:      VirtualCoord::realX(), VirtualCoord::realCoords(),
  1040.                     VirtualCoord::virtY(), VirtualCoord::virtX(),
  1041.                     VirtualCoord::virtCoords()
  1042.  
  1043.  *** Function:      VirtualCoord::virtCoords()
  1044.      Syntax:        void VirtualCoord::virtCoords(unsigned realX, unsigned
  1045.                     realY, unsigned *virtX, unsigned *virtY);
  1046.      Purpose:       Calculate the virtual (x,y) coordinates given the real
  1047.                     coordinates.
  1048.      Parameters:    The virtual (x,y) coordinates are returned in
  1049.                     ('virtX','virtY'), and are calculated based on the real
  1050.                     (x,y) coordinate ('realX','realY').
  1051.      Return value:  None.
  1052.      Remarks:       None.
  1053.      See also:      VirtualCoord::virtX(), VirtualCoord::virtY(),
  1054.                     VirtualCoord::realCoords(), VirtualCoord::realX(),
  1055.                     VirtualCoord::realY()
  1056.  
  1057.  *** Function:      VirtualCoord::virtX()
  1058.      Syntax:        unsigned VirtualCoord::virtX(unsigned realX);
  1059.      Purpose:       Calculate the virtual x-coordinate given the real x-
  1060.                     coordinate.
  1061.      Parameters:    The virtual x-coordinate is returned, calculated based
  1062.                     on the real x-coordinate 'realX'.
  1063.      Return value:  Returns the virtual x-coordinate.
  1064.      Remarks:       None.
  1065.      See also:      VirtualCoord::virtY(), VirtualCoord::virtCoords(),
  1066.                     VirtualCoord::realX(), VirtualCoord::realY(),
  1067.                     VirtualCoord::realCoords()
  1068.  
  1069.  *** Function:      VirtualCoord::virtY()
  1070.      Syntax:        unsigned VirtualCoord::virtY(unsigned realY);
  1071.      Purpose:       Calculate the virtual y-coordinate given the real y-
  1072.                     coordinate.
  1073.      Parameters:    The virtual y-coordinate is returned, calculated based
  1074.                     on the real y-coordinate 'realY'.
  1075.      Return value:  Returns the virtual y-coordinate.
  1076.      Remarks:       None.
  1077.      See also:      VirtualCoord::virtX(), VirtualCoord::virtCoords(),
  1078.                     VirtualCoord::realY(), VirtualCoord::realX(),
  1079.                     VirtualCoord::realCoords()
  1080.  
  1081.  
  1082.  
  1083. VIRTUAL SCREENS
  1084. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1085.  
  1086.      In previous releases of TGE, all graphics input and output operations
  1087.      were done on the screen.  Now four different I/O arrangements are
  1088.      available:
  1089.         - Input and output on the real screen.
  1090.         - Input and output on a virtual screen (ie. in memory).
  1091.         - Input from the real screen, and output to a virtual screen.
  1092.         - Input from a virtual screen, and output to the real screen.
  1093.      As well, it is possible to switch between these four I/O modes at any
  1094.      time with one or two simple function calls.
  1095.  
  1096.      Virtual screens are useful for such tasks as building complex images
  1097.      off-screen, then displaying them quickly.  Since a virtual screen has
  1098.      exactly the same format as the images used by getImage() and its
  1099.      associated functions, they can be displayed using a putImage() or
  1100.      putImageInv() call, simply by passing the address of the virtual
  1101.      screen as the address of the image to be displayed.
  1102.  
  1103.  
  1104.      A virtual screen is created using the following function:
  1105.  
  1106.  *** Function:      makeVirtScreen()
  1107.      Syntax:        void far *makeVirtScreen(unsigned wide, unsigned deep);
  1108.      Purpose:       Allocate enough RAM to store a virtual screen with the
  1109.                     specified dimensions, then initialize it.
  1110.      Parameters:    A virtual screen with width 'wide' and depth 'deep' (in
  1111.                     pixels) will be created.
  1112.      Return value:  Returns the address of the newly allocated virtual
  1113.                     screen, or NULL if there is not enough memory to create
  1114.                     it.
  1115.      Remarks:            Don't forget to de-allocate (using farfree()) the
  1116.                     memory occupied by a virtual screen when the screen is
  1117.                     no longer needed.
  1118.                          After it is allocated, a virtual screen will
  1119.                     likely be filled with random pixels.  Clearing it using
  1120.                     clearGraphics() is often a good idea (after graphics
  1121.                     output has been set to the virtual screen).
  1122.      See also:      None.
  1123.      
  1124.  
  1125.      The functions used to establish input and output to and from real and
  1126.      virtual screens are:
  1127.  
  1128.  *** Function:      graphicsAddr()
  1129.      Syntax:        void graphicsAddr(void far *addr);
  1130.      Purpose:       Set the location upon which graphics input and output
  1131.                     will both be performed.
  1132.      Parameters:    If 'addr' is equal to NULL, input and output will be
  1133.                     performed on the real screen; if 'addr' is non-NULL,
  1134.                     input and output will be performed on the virtual
  1135.                     screen pointed to by 'addr'.
  1136.      Return value:  None.
  1137.      Remarks:       This function sets the currently active input and
  1138.                     output viewports to cover the entirety of the virtual
  1139.                     screen.  INMAXX, INMAXY, OUTMAXX, and OUTMAXY are also
  1140.                     changed appropriately.
  1141.      See also:      graphicsInputAddr(), graphicsOutputAddr()
  1142.  
  1143.  *** Function:      graphicsInputAddr()
  1144.      Syntax:        void graphicsInputAddr(void far *addr);
  1145.      Purpose:       Set the location upon which graphics input will be
  1146.                     performed.
  1147.      Parameters:    If 'addr' is equal to NULL, input will be performed on
  1148.                     the real screen; if 'addr' is non-NULL, input will be
  1149.                     performed on the virtual screen pointed to by 'addr'.
  1150.      Return value:  None.
  1151.      Remarks:       This function sets the currently active input viewport
  1152.                     to cover the entirety of the virtual screen.  INMAXX
  1153.                     and INMAXY are also changed appropriately.
  1154.      See also:      graphicsOutputAddr(), graphicsAddr()
  1155.  
  1156.  *** Function:      graphicsOutputAddr()
  1157.      Syntax:        void graphicsOutputAddr(void far *addr);
  1158.      Purpose:       Set the location upon which graphics output will be
  1159.                     performed.
  1160.      Parameters:    If 'addr' is equal to NULL, output will be performed on
  1161.                     the real screen; if 'addr' is non-NULL, output will be
  1162.                     performed on the virtual screen pointed to by 'addr'.
  1163.      Return value:  None.
  1164.      Remarks:       This function sets the currently active output viewport
  1165.                     to cover the entirety of the virtual screen.  OUTMAXX
  1166.                     and OUTMAXY are also changed appropriately.
  1167.      See also:      graphicsInputAddr(), graphicsAddr()
  1168.  
  1169.  
  1170.  
  1171. GRAPHICAL OUTPUT MODES
  1172. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1173.  
  1174.      In previous releases of TGE, all graphics output was copied to the
  1175.      screen.  Now output can be copied, ANDed, NOTed, ORed, or XORed, even
  1176.      to virtual screens.  A description of each of these output modes
  1177.      follows:
  1178.         - COPY:  This mode is the one which will likely be used most
  1179.           frequently.  In this mode, any output is copied directly,
  1180.           overwriting anything which was previously there.
  1181.         - AND:  In this mode, each pixel output is ANDed with the pixel
  1182.           already at the same location.
  1183.         - NOT:  In this mode, each pixel output is NOTed before being
  1184.           output.
  1185.         - OR:  In this mode, each pixel output is ORed with the pixel
  1186.           already at the same location.
  1187.         - XOR:  In this mode, each pixel output is XORed with the pixel
  1188.           already at the same location.
  1189.  
  1190.  
  1191.      The following function allows selection of the output mode:
  1192.  
  1193.  *** Function:      setOutputMode()
  1194.      Syntax:        void setOutputMode(int mode);
  1195.      Purpose:       Select the currently used output mode.
  1196.      Parameters:    The output mode will be set to COPY if 'mode' is
  1197.                     TGE_COPY_PUT, AND if it is TGE_AND_PUT, NOT if it is
  1198.                     TGE_NOT_PUT, OR if it is TGE_OR_PUT, or XOR if it is
  1199.                     TGE_XOR_PUT.  These macros are defined in TGE.H.
  1200.      Return value:  None.
  1201.      Remarks:       The newly chosen output mode will take effect even if
  1202.                     output is directed to a virtual screen.
  1203.      See also:      None.
  1204.  
  1205.  
  1206.  
  1207. FONTS
  1208. ▀▀▀▀▀
  1209.  
  1210.      TGE supports loadable fonts, implemented in C++ using the "Font"
  1211.      class.  At present, TGE's fonts are composed of monochrome bitmaps of
  1212.      a single size, using one bitmap for each character.  Both high- and
  1213.      low-ASCII characters are supported.  As well, multiple fonts may be
  1214.      resident in memory simultaneously.
  1215.  
  1216.      In order to use a font, an instance of the Font class is necessary. 
  1217.      Assuming instantiation of a Font pointer, font initialization will
  1218.      look something like this:
  1219.  
  1220.           Font *systemFont;
  1221.           char systemFontName[] = "8x16.fnt";
  1222.                     .
  1223.                     .
  1224.                     .
  1225.           systemFont = new Font(systemFontName); // load font
  1226.           if (!systemFont || !systemFont->status())
  1227.           {
  1228.             printf("Error loading %s, aborting.\n\n", systemFontName);
  1229.             exit(1);
  1230.           }
  1231.  
  1232.      Once a font has been loaded, it may be manipulated via its Font class
  1233.      instance.  A complete list of the Font member functions follows.
  1234.  
  1235.  
  1236.  *** Function:      Font::Font()
  1237.      Syntax:        Font::Font(char *filename, unsigned char fg=1, unsigned
  1238.                     char bg=0);
  1239.      Purpose:       Load a font, and initiate a Font class for use with it.
  1240.      Parameters:    'filename' is the name of the font data file.  'fg'
  1241.                     (optional) is the colour to be used as the foreground
  1242.                     colour.  'bg' (optional) is the colour to be used as
  1243.                     the background colour.
  1244.      Return value:  None.
  1245.      Remarks:       After an instantiation of a Font, ensure that the
  1246.                     loading and initialization was successful using the
  1247.                     method illustrated above.
  1248.      See also:      Font::~Font()
  1249.  
  1250.  *** Function:      Font::~Font()
  1251.      Syntax:        Font::~Font()
  1252.      Purpose:       Free the memory used by a font, and perform any other
  1253.                     clean-up actions when a Font is no longer needed.
  1254.      Parameters:    None.
  1255.      Return value:  None.
  1256.      Remarks:       None.
  1257.      See also:      Font::Font()
  1258.  
  1259.  *** Function:      Font::status()
  1260.      Syntax:        inline int Font::status(void);
  1261.      Purpose:       Return a flag indicating whether or not the font
  1262.                     loading and initialization were successful.
  1263.      Parameters:    None.
  1264.      Return value:  Returns 1 if the initialization was successful, or 0 if
  1265.                     it wasn't.
  1266.      Remarks:       None.
  1267.      See also:      None.
  1268.  
  1269.  *** Function:      Font::wide(char*)
  1270.      Syntax:        unsigned Font::wide(char *str);
  1271.      Purpose:       Return the width, in pixels, of a string.
  1272.      Parameters:    The string 'str' is analyzed.
  1273.      Return value:  Returns the width of 'str', in pixels.
  1274.      Remarks:       None.
  1275.      See also:      Font::wide(char), Font::deep(char*), Font::deep(char),
  1276.                     Font::maxWide(), Font::maxDeep()
  1277.  
  1278.  *** Function:      Font::wide(char)
  1279.      Syntax:        inline unsigned Font::wide(char ch);
  1280.      Purpose:       Return the width, in pixels, of a single character.
  1281.      Parameters:    The character 'ch' is analyzed.
  1282.      Return value:  Returns the width of 'ch', in pixels.
  1283.      Remarks:       None.
  1284.      See also:      Font::wide(char*), Font::deep(char), Font::deep(char*),
  1285.                     Font::maxWide(), Font::maxDeep()
  1286.  
  1287.  *** Function:      Font::maxWide(void)
  1288.      Syntax:        inline unsigned maxWide(void);
  1289.      Purpose:       Return the width of the widest character.
  1290.      Parameters:    None.
  1291.      Return value:  Returns the width of the widest character.
  1292.      Remarks:       None.
  1293.      See also:      Font::maxDeep(void), Font::wide(char*),
  1294.                     Font::wide(char), Font::deep(char*), Font::deep(char)
  1295.      
  1296.  *** Function:      Font::deep(char*)
  1297.      Syntax:        unsigned Font::deep(char *str);
  1298.      Purpose:       Return the depth, in pixels, of a string.
  1299.      Parameters:    The string 'str' is analyzed.
  1300.      Return value:  Returns the depth of 'str', in pixels.
  1301.      Remarks:       None.
  1302.      See also:      Font::deep(char), Font::wide(char*), Font::deep(char),
  1303.                     Font::maxDeep(), Font::maxWide()
  1304.  
  1305.  *** Function:      Font::deep(char)
  1306.      Syntax:        unsigned Font::deep(char ch);
  1307.      Purpose:       Return the depth, in pixels, of a single character.
  1308.      Parameters:    The character 'ch' is analyzed.
  1309.      Return value:  Returns the depth of 'ch', in pixels.
  1310.      Remarks:       None.
  1311.      See also:      Font::deep(char*), Font::wide(char), Font::wide(char*),
  1312.                     Font::maxWide(), Font::maxDeep()
  1313.  
  1314.  *** Function:      Font::maxDeep(void)
  1315.      Syntax:        inline unsigned maxDeep(void);
  1316.      Purpose:       Return the depth of the deepest character.
  1317.      Parameters:    None.
  1318.      Return value:  Returns the depth of the deepest character.
  1319.      Remarks:       None.
  1320.      See also:      Font::maxWide(void), Font::deep(char*),
  1321.                     Font::deep(char), Font::wide(char*), Font::wide(char)
  1322.  
  1323.  *** Function:      Font::put(int, int, char*)
  1324.      Syntax:        void Font::put(int x, int y, char *str);
  1325.      Purpose:       Write a string to the screen.
  1326.      Parameters:    The string 'str' will be written starting at ('x','y').
  1327.      Return value:  None.
  1328.      Remarks:       The coordinate passed to this function specifies the
  1329.                     upper-left coordinate of the string.
  1330.      See also:      Font::put(char);
  1331.      
  1332.  *** Function:      Font::put(int, int, char)
  1333.      Syntax:        void Font::put(int x, int y, char ch);
  1334.      Purpose:       Write a single character to the screen.
  1335.      Parameters:    The character 'ch' will be written at ('x','y').
  1336.      Return value:  None.
  1337.      Remarks:       The coordinate passed to this function specifies the
  1338.                     upper-left coordinate of the character.
  1339.      See also:      Font::put(char*);
  1340.  
  1341.  *** Function:      Font::foreground(unsigned)
  1342.      Syntax:        inline void Font::foreground(unsigned colour);
  1343.      Purpose:       Set the current foreground colour.
  1344.      Parameters:    The foreground colour will be set to 'colour'.
  1345.      Return value:  None.
  1346.      Remarks:       None.
  1347.      See also:      Font::background(unsigned), Font::foreground(void),
  1348.                     Font::background(void)
  1349.  
  1350.  *** Function:      Font::foreground(void)
  1351.      Syntax:        inline unsigned Font::foreground(void);
  1352.      Purpose:       Return the current foreground colour.
  1353.      Parameters:    None.
  1354.      Return value:  Returns the current foreground colour.
  1355.      Remarks:       None.
  1356.      See also:      Font::background(void), Font::foreground(unsigned),
  1357.                     Font::foreground(unsigned)
  1358.  
  1359.  *** Function:      Font::background(unsigned)
  1360.      Syntax:        inline void Font::background(unsigned colour);
  1361.      Purpose:       Set the current background colour.
  1362.      Parameters:    The background colour will be set to 'colour'.
  1363.      Return value:  None.
  1364.      Remarks:       None.
  1365.      See also:      Font::foreground(unsigned), Font::background(void),
  1366.                     Font::foreground(void)
  1367.  
  1368.  *** Function:      Font::background(void)
  1369.      Syntax:        inline unsigned Font::background(void);
  1370.      Purpose:       Return the current background colour.
  1371.      Parameters:    None.
  1372.      Return value:  Returns the current background colour.
  1373.      Remarks:       None.
  1374.      See also:      Font::foreground(void), Font::background(unsigned),
  1375.                     Font::foreground(unsigned)
  1376.  
  1377.  
  1378.      Note that, at present, TGE's fonts are designed for use in 256-colour
  1379.      modes only.
  1380.  
  1381.  
  1382.  
  1383. BITMAP MANIPULATION
  1384. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1385.  
  1386.      Bitmaps can get boring when all you can do is display them.  TGE now
  1387.      allows bitmaps to be scaled to different sizes, using the following
  1388.      function:
  1389.  
  1390.  
  1391.  *** Function:      scaleBitmap(void *srcImage, unsigned newWide, unsigned
  1392.                     newDeep, void *destImage)
  1393.      Syntax:        void scaleBitmap();
  1394.      Purpose:       Scale the given bitmap to the specified size, placing
  1395.                     the resulting bitmap in the specified memory region.
  1396.      Parameters:    The image in 'srcImage' will be scaled to be 'newWide'
  1397.                     pixels wide and 'newDeep' pixels deep; the resulting
  1398.                     scaled image will be placed in 'destImage'.
  1399.      Return value:  None.
  1400.      Remarks:       Results are undefined if either 'newWide' or 'newDeep'
  1401.                     is equal to zero.
  1402.      See also:      None.
  1403.  
  1404.  
  1405.  
  1406. USING THE MOUSE
  1407. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1408.  
  1409.      TGE now provides support for interrupt-driven, definable mouse
  1410.      pointers.  In order to make use of this feature, some simple steps
  1411.      must be taken.
  1412.  
  1413.      The new mouse handler is designed to work in tandem with TGE's
  1414.      graphical functions.  Programs using the new mouse handler must first
  1415.      have successfully initialized graphics mode using TGE.  Both TGE.H and
  1416.      TGEMOUSE.H must be #included into a program using the mouse services.
  1417.  
  1418.      The mouse handler has to be initialized.  To do so, one function call
  1419.      is required:
  1420.  
  1421.           initNewMouse();
  1422.  
  1423.      For more information on initNewMouse(), refer to the mouse functions
  1424.      reference section.
  1425.  
  1426.      Next, the mouse driver must be informed of the screen dimensions, like
  1427.      this:
  1428.  
  1429.           setHorizLimitsMouse(0, OUTMAXX);
  1430.           setVertLimitsMouse(0, OUTMAXY);
  1431.  
  1432.      If desired, the pointer may then be positioned.  To center it on the
  1433.      screen, do this:
  1434.  
  1435.           setPosMouse(OUTMAXX/2, OUTMAXY/2);
  1436.  
  1437.      A pointer shape must then be selected.  TGE, as shipped, includes two
  1438.      arrow pointers and two target pointers; the file MOUSEPTR.C may easily
  1439.      be modified to allow more.  To select, for instance, the big arrow
  1440.      pointer, do this:
  1441.  
  1442.           setupMousePointer(BIG_ARROW_POINTER);
  1443.  
  1444.      The macro BIG_ARROW_POINTER is defined in TGEMOUSE.H; it expands to a
  1445.      number which is used by MOUSEPTR.C to identify which bitmap to use. 
  1446.      Note that if exceptionally large (ie. larger than 512 bytes) pointers
  1447.      are used, a change must be made in NEWMOUSE.ASM; see that file for
  1448.      details.
  1449.  
  1450.      Once things have been initialized, the use of the new mouse handler
  1451.      over the default driver can essentially be ignored; mouse driver
  1452.      services are obtained in exactly the same way.  The file TGEMOUSE.ASM
  1453.      contains functions to interface to most of the mouse driver's
  1454.      services; they are prototyped in TGEMOUSE.H, also using the macro
  1455.      method which allows function names to be changed simply by editing
  1456.      TGEMOUSE.H.
  1457.  
  1458.      Before exiting the program, the function deInitNewMouse() _must_ be
  1459.      called.  It is often a good idea to place deInitNewMouse() in the
  1460.      atexit() queue.
  1461.  
  1462.      Note that, since the pointer is drawn using TGE's putImageInv()
  1463.      function, the pointer will only appear when it is within the current
  1464.      viewport.
  1465.  
  1466.  
  1467.  
  1468. TGE'S MOUSE FUNCTION SET
  1469. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1470.  
  1471.  *** Function:      initNewMouse()
  1472.      Syntax:        void initNewMouse(void);
  1473.      Purpose:       Initializes the new mouse handler.
  1474.      Parameters:    The new mouse handler will be configured for use with
  1475.                     TGE.
  1476.      Return value:  None.
  1477.      Remarks:            A graphics driver must have been loaded prior to a
  1478.                     call to initNewMouse().
  1479.                          The new mouse handler requires that a Microsoft or
  1480.                     compatible mouse driver already be resident.  It
  1481.                     assumes that a mouse driver's presence will have been
  1482.                     tested beforehand.
  1483.                          initNewMouse() is really a simple macro; refer to
  1484.                     TGEMOUSE.H for the expansion of initNewMouse(void);
  1485.      See also:      deInitNewMouse(), enableNewMouse(), disableNewMouse()
  1486.  
  1487.  *** Function:      deInitNewMouse()
  1488.      Syntax:        void deInitNewMouse(void);
  1489.      Purpose:       Deactivate the new mouse handler, and leave all the
  1490.                     work up to the old driver.
  1491.      Parameters:    None.
  1492. *    Return value:  None.
  1493.      Remarks:       This function must be called prior to program exit if
  1494.                     initNewMouse() had previously been called.
  1495.      See also:      initNewMouse(), enableNewMouse(), disableNewMouse()
  1496.  
  1497.  *** Function:      enableNewMouse()
  1498.      Syntax:        void enableNewMouse(void);
  1499.      Purpose:       Reactivate the new mouse handler following a call to
  1500.                     disableNewMouse().
  1501.      Parameters:    None.
  1502.      Return value:  None.
  1503.      Remarks:       None.
  1504.      See also:      disableNewMouse(), initNewMouse(), deInitNewMouse()
  1505.  
  1506.  *** Function:      disableNewMouse()
  1507.      Syntax:        void disableNewMouse(void);
  1508.      Purpose:       Temporarily deactivate the new mouse handler, to be
  1509.                     reactivated later by a call to enableNewMouse().
  1510.      Parameters:    None.
  1511.      Return value:  None.
  1512.      Remarks:       Following a call to this function, the new mouse
  1513.                     handler will cease trapping mouse driver interrupts and
  1514.                     moving the pointer.
  1515.      See also:      enableNewMouse(), initNewMouse(), deInitNewMouse()
  1516.  
  1517.  *** Function:      resetMouse()
  1518.      Syntax:        int resetMouse(void);
  1519.      Purpose:       Reset the mouse driver and hardware.
  1520.      Parameters:    None.
  1521.      Return value:  1 if mouse driver available, 0 otherwise.
  1522.      Remarks:       Following a call to this function, the mouse pointer is
  1523.                     hidden and positioned at the center of the screen.
  1524.      See also:      softResetMouse(), initNewMouse()
  1525.  
  1526.  *** Function:      getButtonsMouse()
  1527.      Syntax:        int getButtonsMouse(void);
  1528.      Purpose:       Return the number of buttons on the mouse.
  1529.      Parameters:    None.
  1530.      Return value:  Returns the number of buttons on the mouse.
  1531.      Remarks:       This function calls resetMouse(), and so the mouse
  1532.                     driver and hardware are re-initialized.
  1533.      See also:      resetMouse()
  1534.  
  1535.  *** Function:      showMouse()
  1536.      Syntax:        void showMouse(void);
  1537.      Purpose:       Show the mouse pointer.
  1538.      Parameters:    None.
  1539.      Return value:  None.
  1540.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  1541.                     ie., if showMouse() is called twice, hideMouse() must
  1542.                     be called twice to hide the pointer again.
  1543.      See also:      hideMouse()
  1544.  
  1545.  *** Function:      hideMouse()
  1546.      Syntax:        void hideMouse(void);
  1547.      Purpose:       Hide the mouse pointer.
  1548.      Parameters:    None.
  1549.      Return value:  None.
  1550.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  1551.                     ie., if showMouse() is called twice, hideMouse() must
  1552.                     be called twice to hide the pointer again.
  1553.      See also:      showMouse()
  1554.  
  1555.  *** Function:      getPosMouse()
  1556.      Syntax:        void getPosMouse(int far *x, int far *y);
  1557.      Purpose:       Get the current pointer coordinates.
  1558.      Parameters:    The current pointer x- and y-coordinates will be stored
  1559.                     in 'x' and 'y', respectively.
  1560.      Return value:  None.
  1561.      Remarks:       None.
  1562.      See also:      setPosMouse()
  1563.  
  1564.  *** Function:      setPosMouse()
  1565.      Syntax:        void setPosMouse(unsigned x, unsigned y);
  1566.      Purpose:       Set the current pointer coordinates.
  1567.      Parameters:    The pointer will be positioned at ('x','y').
  1568.      Return value:  None.
  1569.      Remarks:       None.
  1570.      See also:      getPosMouse()
  1571.  
  1572.  *** Function:      buttonMouse()
  1573.      Syntax:        int buttonMouse(void);
  1574.      Purpose:       Return whether or not any of the mouse buttons is down.
  1575.      Parameters:    None.
  1576.      Return value:  Returns true if at least one button is down, or zero if
  1577.                     none of them is down.
  1578.      Remarks:       None.
  1579.      See also:      leftButtonMouse(), rightButtonMouse(),
  1580.                     centerButtonMouse(), waitReleaseMouse()
  1581.  
  1582.  *** Function:      leftButtonMouse()
  1583.      Syntax:        int leftButtonMouse(void);
  1584.      Purpose:       Return the status of the left mouse button.
  1585.      Parameters:    None.
  1586.      Return value:  Returns true if the button is down, or zero if it is
  1587.                     up.
  1588.      Remarks:       None.
  1589.      See also:      buttonMouse(), rightButtonMouse(), centerButtonMouse(),
  1590.                     waitReleaseMouse()
  1591.  
  1592.  *** Function:      rightButtonMouse()
  1593.      Syntax:        int rightButtonMouse(void);
  1594.      Purpose:       Return the status of the right mouse button.
  1595.      Parameters:    None.
  1596.      Return value:  Returns true if the button is down, or zero if it is
  1597.                     up.
  1598.      Remarks:       None.
  1599.      See also:      buttonMouse(), leftButtonMouse(), centerButtonMouse(),
  1600.                     waitReleaseMouse()
  1601.  
  1602.  *** Function:      centerButtonMouse()
  1603.      Syntax:        int centerButtonMouse(void);
  1604.      Purpose:       Return the status of the center mouse button.
  1605.      Parameters:    None.
  1606.      Return value:  Returns true if the button is down, or zero if it is
  1607.                     up.
  1608.      Remarks:       None.
  1609.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  1610.                     waitReleaseMouse()
  1611.  
  1612.  *** Function:      buttonPressMouse()
  1613.      Syntax:        unsigned buttonPressMouse(unsigned button, int far *x,
  1614.                     int far *y);
  1615.      Purpose:       Return the number of times the specified button has
  1616.                     been pressed since the last call to this function (with
  1617.                     the same button parameter), and store the coordinates
  1618.                     of the last press.
  1619.      Parameters:    The button 'button' is checked, and may be any of
  1620.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  1621.                     defined in TGEMOUSE.H.  The position of the last press
  1622.                     will be stored in ('x','y').
  1623.      Return value:  Returns the number of times the specified button has
  1624.                     been pressed since the last call to this function (with
  1625.                     the same button parameter).
  1626.      Remarks:       None.
  1627.      See also:      buttonReleaseMouse()
  1628.  
  1629.  *** Function:      buttonReleaseMouse()
  1630.      Syntax:        unsigned buttonReleaseMouse(unsigned button, int far
  1631.                     *x, int far *y);
  1632.      Purpose:       Return the number of times the specified button has
  1633.                     been released since the last call to this function
  1634.                     (with the same button parameter), and store the
  1635.                     coordinates of the last press.
  1636.      Parameters:    The button 'button' is checked, and may be any of
  1637.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  1638.                     defined in TGEMOUSE.H.  The position of the last
  1639.                     release will be stored in ('x','y').
  1640.      Return value:  Returns the number of times the specified button has
  1641.                     been released since the last call to this function
  1642.                     (with the same button parameter).
  1643.      Remarks:       None.
  1644.      See also:      buttonPressMouse()
  1645.  
  1646.  *** Function:      setHorizLimitsMouse()
  1647.      Syntax:        void setHorizLimitsMouse(unsigned min, unsigned max);
  1648.      Purpose:       Set the minimum and maximum horizontal coordinates for
  1649.                     the pointer.
  1650.      Parameters:    The minimum horizontal coordinate will be set to 'min',
  1651.                     and the maximum to 'max'.
  1652.      Return value:  None.
  1653.      Remarks:       None.
  1654.      See also:      setVertLimitsMouse()
  1655.  
  1656.  *** Function:      setVertLimitsMouse()
  1657.      Syntax:        void setVertLimitsMouse(unsigned min, unsigned max);
  1658.      Purpose:       Set the minimum and maximum vertical coordinates for
  1659.                     the pointer.
  1660.      Parameters:    The minimum vertical coordinate will be set to 'min',
  1661.                     and the maximum to 'max'.
  1662.      Return value:  None.
  1663.      Remarks:       None.
  1664.      See also:      setHorizLimitsMouse()
  1665.  
  1666.  *** Function:      setPointerMouse()
  1667.      Syntax:        void setPointerMouse(int xOff, int yOff, void far *p);
  1668.      Purpose:       Set the shape of the pointer.
  1669.      Parameters:    The image pointed to by 'p' will be the pointer bitmap. 
  1670.                     ('xOff','yOff') is the offset, relative to the upper-
  1671.                     left corner of the bitmap, of the "hot spot" -- the
  1672.                     pixel where the pointer is actually registered as
  1673.                     being.  (For instance, the standard arrow pointer has
  1674.                     its hot spot in the upper-left, while a crosshairs
  1675.                     pointer would have it towards the middle.)
  1676.      Return value:  None.
  1677.      Remarks:       The mouse pointer should be hidden when a call to this
  1678.                     function is made.
  1679.      See also:      None.
  1680.  
  1681.  *** Function:      getSaveSizeMouse()
  1682.      Syntax:        unsigned getSaveSizeMouse(void);
  1683.      Purpose:       Return the size of the buffer necessary to store the
  1684.                     state of the mouse driver.
  1685.      Parameters:    None.
  1686.      Return value:  Returns the size of the buffer.
  1687.      Remarks:       If a program using TGE and the new mouse handling
  1688.                     routines is to run another program, for instance
  1689.                     shelling to DOS, the ensuing procedure should be
  1690.                     followed:  call disableNewMouse(), call
  1691.                     getSaveSizeMouse(), allocate a block of memory with the
  1692.                     size returned by getSaveSizeMouse(), call
  1693.                     saveStateMouse(), run the program, call
  1694.                     restoreStateMouse(), free the block of memory, then
  1695.                     call enableNewMouse().
  1696.      See also:      saveStateMouse(), restoreStateMouse()
  1697.  
  1698.  *** Function:      saveStateMouse()
  1699.      Syntax:        void saveStateMouse(void far *buf);
  1700.      Purpose:       Save the current state of the mouse driver.
  1701.      Parameters:    The block of memory pointed to by 'buf' will be used to
  1702.                     store the state data.  Its length should be obtained by
  1703.                     calling getSaveSizeMouse().
  1704.      Return value:  None.
  1705.      Remarks:       If a program using TGE and the new mouse handling
  1706.                     routines is to run another program, for instance
  1707.                     shelling to DOS, the ensuing procedure should be
  1708.                     followed:  call disableNewMouse(), call
  1709.                     getSaveSizeMouse(), allocate a block of memory with the
  1710.                     size returned by getSaveSizeMouse(), call
  1711.                     saveStateMouse(), run the program, call
  1712.                     restoreStateMouse(), free the block of memory, then
  1713.                     call enableNewMouse().
  1714.      See also:      getSaveSizeMouse(), restoreStateMouse()
  1715.  
  1716.  *** Function:      restoreStateMouse()
  1717.      Syntax:        void restoreStateMouse(void far *buf);
  1718.      Purpose:       Restore the state of the mouse driver from a buffer
  1719.                     previously filled by saveStateMouse().
  1720.      Parameters:    The block of memory pointed to by 'buf' stores the
  1721.                     state data.
  1722.      Return value:  None.
  1723.      Remarks:       If a program using TGE and the new mouse handling
  1724.                     routines is to run another program, for instance
  1725.                     shelling to DOS, the ensuing procedure should be
  1726.                     followed:  call disableNewMouse(), call
  1727.                     getSaveSizeMouse(), allocate a block of memory with the
  1728.                     size returned by getSaveSizeMouse(), call
  1729.                     saveStateMouse(), run the program, call
  1730.                     restoreStateMouse(), free the block of memory, then
  1731.                     call enableNewMouse().
  1732.      See also:      getSaveSizeMouse, saveStateMouse
  1733.  
  1734.  *** Function:      setRatioMouse()
  1735.      Syntax:        void setRatioMouse(unsigned horiz, unsigned vert);
  1736.      Purpose:       Set the mouse sensitivity, in units of mickeys per 8
  1737.                     pixels of pointer movement.  (A mickey is the unit used
  1738.                     to measure mouse movement.)
  1739.      Parameters:    The horizontal mickeys to pixels ratio will be set to
  1740.                     'horiz', and the vertical to 'vert'.
  1741.      Return value:  None.
  1742.      Remarks:       None.
  1743.      See also:      getSensitivityMouse()
  1744.  
  1745.  *** Function:      getSensitivityMouse()
  1746.      Syntax:        void getSensitivityMouse(unsigned *horiz, unsigned
  1747.                     *vert, unsigned *doubleSpeed);
  1748.      Purpose:       Get the mouse sensitivity, in units of mickeys per 8
  1749.                     pixels of pointer movement.  (A mickey is the unit used
  1750.                     to measure mouse movement.)  The mouse double speed
  1751.                     threshold (the minimum number of mickeys per second of
  1752.                     motion before pointer movement is doubled) is retrieved
  1753.                     as well.
  1754.      Parameters:    The horizontal mickeys to pixels ratio will be stored
  1755.                     in 'horiz', the vertical in 'vert', and the double
  1756.                     speed threshold in 'doubleSpeed'.
  1757.      Return value:  None.
  1758.      Remarks:       None.
  1759.      See also:      setRatioMouse()
  1760.  
  1761.  *** Function:      softResetMouse()
  1762.      Syntax:        void softResetMouse(void);
  1763.      Purpose:       Reset the mouse driver, but not the hardware.
  1764.      Parameters:    None.
  1765.      Return value:  None.
  1766.      Remarks:       This function is equivalent to resetMouse(), except in
  1767.                     that it performs no initialization of the mouse
  1768.                     hardware.
  1769.      See also:      resetMouse()
  1770.  
  1771.  *** Function:      waitReleaseMouse()
  1772.      Syntax:        void waitReleaseMouse(int button);
  1773.      Purpose:       If the specified button is not already up, wait until
  1774.                     it is released, then return.
  1775.      Parameters:    The button 'button' is checked, and may be any of
  1776.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  1777.                     defined in TGEMOUSE.H.
  1778.      Return value:  None.
  1779.      Remarks:       None.
  1780.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  1781.                     centerButtonMouse()
  1782.  
  1783.  
  1784.      Note that since these function names are actually macros, they may
  1785.      easily be changed to suit individual preferences by editing
  1786.      TGEMOUSE.H.
  1787.  
  1788.  
  1789.  
  1790. CREATING FONTS
  1791. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1792.  
  1793.      Creating fonts is by no means easy, but the necessary information is
  1794.      outlined below.
  1795.  
  1796.      TGE's font definition files must have a certain format, which will be
  1797.      outlined below.  (Note that, at present, a font consists of 256
  1798.      monochrome characters, each with the same dimensions.)
  1799.  
  1800.      The font file header consists of three fields of defined length.  The
  1801.      first of these fields is the eight-byte font definition file signature
  1802.      string, which must be "TGEFONT1", without quotes or terminating null
  1803.      character.  The next field is a two-byte unsigned integer which holds
  1804.      the width of a character in pixels.  The last field is also a two-byte
  1805.      integer, holding the depth of a character in pixels.
  1806.  
  1807.      The remainder of the file consists of font data.  (If you have done
  1808.      advanced text programming before, you may recognize this data
  1809.      organization as the format used by the video BIOS.)  The characters
  1810.      are stored starting at character 0, all the way up to 255.  Each of
  1811.      the characters is stored starting with the uppermost row, all the way
  1812.      down to the bottom row.  Each row is stored left to right, with the
  1813.      leftmost pixel in the most significant bit of the first byte in the
  1814.      row, and the rightmost pixel in the least significant bit of the last
  1815.      byte in the row.  A 1 bit represents a foreground pixel, while a 0 bit
  1816.      represents a background pixel.  Note that, at present, font row widths
  1817.      must be evenly divisible by 8; pad with 0 bits if necessary.
  1818.  
  1819.      Image data for all 256 of the ASCII characters must be present in the
  1820.      file; if you won't be needing some o '     3(el free to store zero
  1821.      bytes (or random bytes, if you're imaginative) as their image data.
  1822.  
  1823.  
  1824.  
  1825. USING THE PCX2RAW UTILITY
  1826. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1827.  
  1828.      The PCX2RAW utility provides a simple way to convert 256-colour images
  1829.      in PCX format into a format usable by TGE.  It is used like this:
  1830.  
  1831.           pcx2raw filename[.pcx]
  1832.  
  1833.      Given the PCX file FILENAME.PCX, PCX2RAW will create two new files in
  1834.      the current directory:  FILENAME.PAL which contains the colour palette
  1835.      from FILENAME.PCX, and FILENAME.RAW which is a TGE format bitmap of
  1836.      the image in FILENAME.PCX.  Following is a discussion of the PAL and
  1837.      RAW file formats.
  1838.  
  1839.  
  1840.      The PAL file is organized like this:
  1841.  
  1842.          Element size    Element description
  1843.          ------------    -------------------
  1844.            3 bytes           colour 0
  1845.            3 bytes           colour 1
  1846.                         .
  1847.                         .
  1848.                         .
  1849.            3 bytes           colour 254
  1850.            3 bytes           colour 255
  1851.  
  1852.      Each 3-byte element consists of the red, green, and blue colour
  1853.      components, in that order.  Each of these components is an unsigned
  1854.      char.  Code to load a PAL file and make it active might look like the
  1855.      following.  For clarity, this function performs no error checking.
  1856.  
  1857.           void loadPalFile(char *filename)
  1858.           {
  1859.             FILE *fp;
  1860.             void far *pal;
  1861.  
  1862.             fp = fopen(filename, "rb");      // open palette file
  1863.             pal = malloc(768);               // grab some RAM
  1864.             fread(pal, 768, 1, fp);          // read in palette data
  1865.             fclose(fp);                      // close the file
  1866.             setBlockPalette(0, 255, pal);    // make palette active
  1867.             free(pal);                       // free memory block
  1868.           }
  1869.  
  1870.  
  1871.      The RAW file is organized in exactly the same way as the bitmaps used
  1872.      by putImage() and its associated functions:
  1873.  
  1874.          Element size    Element description
  1875.          ------------    -------------------
  1876.            2 bytes           image width
  1877.            2 bytes           image depth
  1878.            variable     raw pixel information
  1879.  
  1880.      The image dimension fields are both unsigned ints, and are measured in
  1881.      pixels.  Code to load a PAL file might look like the following.  For
  1882.      clarity, this code performs no error checking.  Note the multiple
  1883.      calls to fread() and the use of huge pointers to allow loading of
  1884.      images larger than 64 K.
  1885.  
  1886.           void far *loadRawFile(char *filename)
  1887.           {
  1888.             FILE *fp;
  1889.             void far *image;
  1890.             char huge *curPos;
  1891.             unsigned long fileSize;
  1892.             unsigned count, wide, deep;
  1893.  
  1894.             //*** Initialize
  1895.             fp = fopen(filename, "rb");      // open the file
  1896.             fseek(fp, 0, SEEK_END);          // seek to end of file
  1897.             fileSize = ftell(fp);            // get file size
  1898.             rewind(fp);                      // seek to file start
  1899.             image = farmalloc(fileSize);     // allocate some RAM
  1900.             curPos = (char huge*)image;      // curPos=image for now
  1901.  
  1902.             //*** Read in image dimensions
  1903.             fread(&wide, 2, 1, fp);          // read in width
  1904.             ((unsigned*)curPos)[0] = wide;   // store it in image header
  1905.             fread(&deep, 2, 1, fp);          // read in depth
  1906.             ((unsigned*)curPos)[1] = deep;   // store it in image header
  1907.             curPos += 4;                     // skip past image header
  1908.  
  1909.             //*** Read in the file line-by-line
  1910.             for (count=0; count<deep; count++)
  1911.             {
  1912.               fread((void far*)curPos, wide, 1, fp); // read in a line
  1913.               curPos += wide;                // update curPos
  1914.             }
  1915.  
  1916.             //*** Clean up and go home
  1917.             fclose(fp);                      // close the file
  1918.             return (image);                  // return pointer to image
  1919.           }
  1920.  
  1921.  
  1922.  
  1923. TERMS OF USAGE AND DISTRIBUTION
  1924. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1925.  
  1926.      The Graphics Engine source code and associated documentation are
  1927.      copyright (c) 1993 by Matthew Hildebrand.
  1928.  
  1929.      The Graphics Engine (or "TGE"), consisting of the files listed in the
  1930.      PACKING LIST section of this document, may be distributed freely as
  1931.      long as:
  1932.           1.   The distributed package is complete, and its contents are
  1933.                not modified in any way.
  1934.           2.   The distributed package is not sold for profit.
  1935.  
  1936.      TGE is not free.  Permission is granted to use TGE, for evaluation
  1937.      purposes only, for a trial period of up to 30 days.  Continuing to use
  1938.      TGE beyond the trial period without purchasing a copy is illegal, even
  1939.      if it is only used privately.  Note that no part of TGE may be used in
  1940.      any distributed program, unless the program was created using a copy
  1941.      of TGE which was purchased prior to program distribution.
  1942.  
  1943.      After an individual or organization ("the Purchaser") has purchased a
  1944.      copy of TGE, the Purchaser is granted permission to:
  1945.           1.   Use any or all of TGE in as many software packages as the
  1946.                Purchaser likes.
  1947.           2.   Distribute any software packages built using TGE without
  1948.                royalties.
  1949.           3.   Modify any of the program code, and use the modified code as
  1950.                described in 1 and 2 above.
  1951.           4.   Use any version of TGE (including new ones as they are
  1952.                released) as described in 1 to 3 above, as long as such
  1953.                usage is in accordance with that version's terms of usage
  1954.                and distribution as described in that version's
  1955.                documentation.
  1956.      By purchasing a copy of TGE, the Purchaser signifies that he/she/it
  1957.      has read and understood the terms of usage and distribution as laid
  1958.      out in this document, and that he/she/it agrees to be bound by them.
  1959.  
  1960.      The privileges granted to the Purchaser by purchasing TGE may be
  1961.      retracted if any of the following conditions is broken:
  1962.           1.   None of the copyright notices contained in TGE's source code
  1963.                may be modified or removed.
  1964.           2.   Any program code derived or directly obtained from TGE's
  1965.                source code may not be distributed unless the recipient has
  1966.                also purchased a copy of TGE.
  1967.           3.   Permission is granted to use TGE to create executable
  1968.                software applications; TGE's source code may not be
  1969.                distributed as part of a software package unless prior
  1970.                written consent is obtained from the author of TGE.
  1971.  
  1972.      In order to purchase a copy of TGE, non-commercial users send $30 (US
  1973.      or Canadian funds) to Matthew Hildebrand at the address listed in
  1974.      CONTACTING THE AUTHOR below; commercial users send $100 per software
  1975.      package built using TGE.  Payment by money order, check, or cash is
  1976.      acceptable.  The file REGISTER.FRM is provided for both your
  1977.      convenience and mine; it is designed to be printed out and filled in.
  1978.      Thank you in advance.
  1979.  
  1980.  
  1981.  
  1982. CONTACTING THE AUTHOR
  1983. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1984.  
  1985.      I would appreciate hearing any questions, comments, bug reports, or
  1986.      suggestions for improvement.  If you have any, feel free to contact
  1987.      me.  I can be reached at any of the following addresses.  When
  1988.      reporting bugs, please be sure to mention the version of TGE to which
  1989.      you are referring.
  1990.  
  1991.  
  1992.      Snail mail:
  1993.           Matthew Hildebrand
  1994.           4 College St.
  1995.           St. Catharines, ON
  1996.           Canada
  1997.           L2R 2W7 
  1998.  
  1999.      Fidonet mail:
  2000.           1:247/128.2
  2001.  
  2002.      Internet mail:      (no guarantees on this one!)
  2003.           Matthew.Hildebrand@p2.f128.n247.z1.fidonet.org
  2004.  
  2005.  
  2006.  
  2007. OBTAINING THE NEWEST VERSION OF TGE
  2008. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2009.  
  2010.      The most recent distributed copy of TGE is available via first-call
  2011.      download from (416)-687-6537 (14.4 kbps, V.32bis).  Note that on
  2012.      October 4 1993, the area code will become 905.
  2013.  
  2014.      TGE is also available via file request from Fidonet node 1:247/128
  2015.      (14400 bps, V.32bis) using the magic file name "TGE"; unlisted nodes
  2016.      and points are welcome.
  2017.  
  2018.      If you are interested in joining the TGE beta team, please contact me
  2019.      as described in the previous section.
  2020.  
  2021.  
  2022.  
  2023. REVISION HISTORY
  2024. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2025.  
  2026.      Legend:   +    Addition
  2027.                !    Change
  2028.                -    Bug fix
  2029.  
  2030.  
  2031.      1.29ßC +  Added support for virtual screens.
  2032.             +  TGE can now output to and input from different places.  For
  2033.                example, it is possible to use a virtual screen for its
  2034.                input whilst using the real screen for its output, or vice-
  2035.                versa.  There is now an input and an output viewport.
  2036.             +  Added the virtual coordinate system, via VCOORD.H.
  2037.             -  Fixed a bug in NEWMOUSE.ASM which would, under rare
  2038.                circumstances, corrupt portions of the screen.
  2039.             !  To avoid memory problems, the palette is no longer
  2040.                saved/restored automatically during text/graphics mode
  2041.                switches.
  2042.             !  setBlockPalette() and getBlockPalette() are now no longer
  2043.                called with the first register and the number of registers
  2044.                to change, but with the first register and the last
  2045.                register. This change allows the whole palette to be set
  2046.                with a single call in 64K-colour modes.
  2047.             +  Improved documentation, describing the font file structure
  2048.                and how to use the PCX2RAW utility and its output.
  2049.             +  TGE can now scale bitmaps, using the scaleBitmap() function.
  2050.             +  Added the imageSizeDim(), putLineInv(), and vertLine()
  2051.                functions.
  2052.             -  Fixed a horrible SVGA bug which caused TGE to work
  2053.                incorrectly on all SVGAs with bank sizes other than 64K.
  2054.  
  2055.      1.20   +  Added support for loadable fonts, viewports, colour
  2056.                approximation, and region fills.
  2057.             !  Rewrote the loadGraphDriver() function; it now returns more
  2058.                descriptive values.
  2059.             +  Added various clipping routines:  clipLine() and
  2060.                clipFilledRect() in CLIP.C, and clipPoint() and
  2061.                pointOnScreen() as macros in TGE.H.
  2062.             -  Fixed aspect ratio problem in 360x480 driver.
  2063.             -  Fixed bug in the 800x600 driver when run with the Trident
  2064.                8900 chipset.
  2065.             +  Added the REGISTER.FRM file.
  2066.  
  2067.      1.10   -  Improved and debugged SuperVGA support.  Bugs squashed
  2068.                include the infamous Trident and Oak bugs.
  2069.             +  Added drivers for VGA 360x480 and SuperVGA 1024x768.
  2070.             +  Added interrupt-driven definable mouse pointer services, as
  2071.                well as miscellaneous mouse routines.
  2072.             -  Fixed default palette routines to do translation between 6-
  2073.                bit and 8-bit values.
  2074.             +  Added ellipse(), filledEllipse(), circle(), and
  2075.                filledCircle().
  2076.             +  Added PCX2RAW, a utility to convert 256-colour PCX files
  2077.                into raw bitmap and raw palette files.  This utility makes
  2078.                importing graphics easy.
  2079.  
  2080.      1.01   +  First public release.
  2081.  
  2082.  
  2083.  
  2084. KNOWN PROBLEMS USING TGE
  2085. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2086.  
  2087.      At present, the following problems may be experienced when using TGE:
  2088.  
  2089.           1.   When TGE.C is compiled by Turbo C++ 3.0, putImage() and
  2090.                putImageInv() do not work correctly.  When informed of this
  2091.                bug, I stepped through the offending code at the assembly
  2092.                level, and discovered that this problem is caused by a bug
  2093.                in TC++, not TGE.  The miscompiled lines of TGE.C are
  2094.                perfectly legal C statements; when TGE.C is compiled by my
  2095.                compiler (Borland C++ 2.0), TGE works beautifully.
  2096.           2.   A very small number of users may experience an odd pattern
  2097.                of blue lines when TGE is run in an SVGA mode on some older
  2098.                ATI cards.  I have been informed that this problem is caused
  2099.                by a bug in the video card itself.  ATI has confirmed the
  2100.                presence of this bug, and has implemented a software patch
  2101.                in its Windows 3.1 SVGA driver, but ATI has not released
  2102.                information on how this bug was squashed.
  2103.           3.   Any bugs listed in BETATEST.DOC.
  2104.  
  2105.  
  2106.  
  2107. ACKNOWLEDGEMENT
  2108. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2109.  
  2110.      There are many people whom I would like to thank for their
  2111.      suggestions, beta-testing, patience, registrations, and help with
  2112.      distribution.  You know who you are.
  2113.  
  2114.  
  2115.  
  2116. LEGAL MUMBO JUMBO
  2117. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2118.  
  2119.      The Graphics Engine source code and associated documentation are
  2120.      copyright (c) 1993 by Matthew Hildebrand.
  2121.  
  2122.      All software and documentation associated with The Graphics Engine is
  2123.      provided "as is":  ie., it is provided without warranty of any kind,
  2124.      not even an implied warranty of merchantability or fitness for any
  2125.      purpose.  The Author (Matthew Hildebrand) disclaims all warranties,
  2126.      both express and implied, including but not limited to warranties
  2127.      regarding The Graphics Engine's merchantability or fitness for any
  2128.      particular purpose.
  2129.  
  2130.      The author may not be held liable for any damage or misfortune that
  2131.      the use of this software may cause.  The usage of any of The Graphics
  2132.      Engine is done entirely at the user's risk.
  2133.  
  2134.      All registered trademarks in this document belong to whomever it is
  2135.      that owns them.
  2136.  
  2137.  
  2138.  
  2139. End of document.
  2140.